import request from "@/utils/request.js";

// 获得处方信息
export function drugInfo(id, data) {
    return request.get(`wx/order/drug/${id}`, data)
}

// 1.新增就诊人
export function addPatient(data) {
    return request.post('wx/patient/add', data)
}
// 验证姓名和idCard
export function checkNameId(data) {
    return request.post('wx/common/getIsRealName', data)
}


// 4.获取验证码
export function getCode(data) {
    return request.post('app/login/getMessageCode', data, {
        noAuth: false,
        noVerify: true,
    })
}
//6.编辑就诊人健康史
export function edithealth(data) {
    return request.post('wx/patient/saveUserHealthy', data)
}
// 7.编辑就诊人生活习惯
export function editliveHabit(data) {
    return request.post('wx/patient/saveUserHabitInfo', data)
}
// 8.新增收货地址
export function getAddress(data) {
    return request.post('wx/patient/add/address', data)
}
//9.删除收货地址
export function delAddress(id, data) {
    return request.post(`wx/patient/delete/address/${id}`, data)
}
// 10.获得就诊人实名状态
export function verifyStatus(id, data) {
    return request.get(`wx/patient/verified/status`, data)
}
// 11.现场开方就诊人实名认证
export function realName(data) {
    return request.post(`wx/patient/real/name`, data)
}

// 13.根据患者处方id获得就诊人信息
export function getPatientIdByPrescriptionId(data) {
    return request.get(`wx/patient/info/order`, data)
}
// 14.我的问诊列表
export function onsultationList(status) {
    return request.get(`wx/order/inquiry/list/${status}`)
}
// 15.我的药品列表
export function drugList(status) {
    return request.get(`wx/order/drug/order/list/${status}`)
}

// 16.现场开处方完善订单
export function toPayfor(data) {
    return request.post(`wx/order/create`, data)
}

// 获取临床诊断（疾病）
export function getDiagnosis(searchName) {
    return request.get(`wx/order/diagnosis`, searchName)
}

// 获取药品列表
export function getDrugs(data) {
    return request.get(`wx/order/drug/type`, data)
}

//
// 就诊人详情
export function patientDetail(data) {
    return request.get(`wx/patient/detail/` + data)
}

// 获取生活习惯字典
export function getLiveHabit(data) {
    return request.get(`wx/common/getHabitChoice`, data)
}

/**
 * 17查询健康史
 *
 */
export function healthHistory(data) {
    return request.get(`app/patient/health/history/` + data);
}
/**
 *18.查询患者生活习惯
 *
 */
export function livingHabit(data) {
    return request.get(`app/patient/living/habit/` + data);
}

//支付回调(仅测试调用，正式环境走异步回调)
export function paySuccess(orderId) {
    return request.post('foregin/order/pay/success/' + orderId);
}
//客服
export function customerService() {
    return request.get('wx/common/configKey/custom-phone')
}
//消息中心未读消息条数
export function noRead() {
    return request.get('app/message/center/no/read');
}
//根据消息类型查询消息
export function messageType(data) {
    return request.get('app/message/center/type/message', data);
}
//消息通知详情
export function messageDetail(id) {
    return request.get('app/message/center/notice/detail', id);
}
//更新消息通知状态为已读
export function noticeStatus(data) {
    return request.post('app/message/center/update/notice/status', data);
}
// 电子处方
export function electronic(id) {
    return request.get('app/set/up/electronic/prescription/patient/detail', id)
}


// 扫码确认处方
export function confirmRP(id) {
    return request.post(`wx/order/update/rp/${id}`)
}
// 查询物流详情
export function getGoodOrder(orderId) {
    return request.get('wx/order/getGoodOrder/' + orderId);
}

// app/config/configKey/express_money
// 查询配送费接口
export function distributionFee() {
    return request.get('app/config/configKey/express_money');
}

// 取消关注
export function updateBind(doctorId) {
    return request.get(`wx/doctor/updateBind/${doctorId}`)
}

//查订单快递位置详情
export function getposition(orderId) {
    return request.get(`app/operate/getDadaOrderDetail/${orderId}`)
}